<template>
  <div class="layout">
    <div class="content">
      <!-- 二级路由出口，匹配到的二级路由 -->
      <router-view></router-view>
    </div>
    <div class="footer_wrap">
      <router-link to="/article">面经</router-link>
      <router-link to="/collect">收藏</router-link>
      <router-link to="/like">喜欢</router-link>
      <router-link to="/user">我的</router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: "LayOut",
  created() {
    console.log('被创建');
  },
  mounted() {
    console.log('被挂载');
  },
  destroyed() { 
    console.log('被销毁');
  },
  activated() {
    console.log('被激活');
  },
  deactivated() {
    console.log('被失活');
  }
};
</script>

<style scoped>
/* 底部导航 */
.footer_wrap {
  position: fixed;
  left: 0;
  bottom: 0;
  display: flex;
  width: 100%;
  text-align: center;
  background-color: #333;
  color: white;
}
.footer_wrap a {
  flex: 1;
  text-decoration: none;
  padding: 20px 0;
  line-height: 20px;
  font-size: 14px;
  color: #fff;
  border: 1px solid black;
}
/* 模糊匹配高亮，用的比较多，对于多级路由时 */
.footer_wrap a.active {
  background-color: darkgoldenrod;
}
.footer_wrap a:hover {
  box-shadow: inset 0 0 10px 0px white;
}
</style>